#ifndef JOG_MODE_H
#define JOG_MODE_H

#include "cncmode.h"

namespace cnc {

	namespace base {

		class JogMode : public CNCMode
		{
		public:
			JogMode() : CNCMode(cnc::base::OPMODE_JOG) {}
			virtual bool start()
			{
				uiService_->selectForm("jogMode");
				return true;
			}
			virtual bool execute()
			{
				cnc::comm::KbdCommand kbdCmd;
				if (keyboard_->getCommand(&kbdCmd)) {
					//uiService_->setCommand(kbdCmd);
					switch(kbdCmd.getID()) {
						case cnc::comm::AXIS::ID:
							
							break;
						case cnc::comm::MODE::ID:
							if (selectMode(opMode_[kbdCmd.getValue()]))
							{
								
								break;
							}
							return false;
					}
		#ifdef _DEBUG
					if (kbdCmd.getID() == 0xFFFF && kbdCmd.getValue() == 0xFFFF)
						return false;
					printCommand(kbdCmd);
		#endif
				}
				return true;
			}
			virtual bool stop()
			{
				return true;
			}
		};

	} // namespace base

} // namespace cnc

#endif
